#include <string>
using namespace std;

class Dictionary {
private:
    string entry[256];
    int end = -1;
public:
    void addEntry(string word) {
        end++;
        entry[end] = new string(word);
        this.addItem(end + " : " + word, end);
        this.select(end);               
    }

    void addEntry(char letter) {
        end++;
        entry[end] = new string("" + letter);
        this.addItem(end + " : " + letter, end);
        this.select(end);               
    }
    void addEntry(int letter) {
        char c = (char)(letter);
        end++;
        entry[end] = new string("" + c );
        this.addItem(end + " : " + c, end);
        this.select(end);               
    }
    int findEntry(string word) {

        // returns the index number if found, -1 if not

        for (int i = 0; i <= end; i++) {
            if ( word.equals(entry[i]) ) {
                // this.select(i);
                return i;
            }
        }
        return -1;
    }
    string returnEntry(int code) {
        this.select(code);
        if ( code > end )
            return "";
        else        
            return entry[code];
    }
};